/**
 *	VisualGroup JavaScript prototype Classes, version 0.1
 *  (c) 2006 Bill Vison <vison_ruan@126.com>
 *  The core processor defined 
 *
/*--------------------------------------------------------------------------*/
using("Vsg.Menu");
using("Vsg.Menu.MenuProcessor");

Vsg.Menu.GenericMenuProcessor = Ext.extend(Ext.util.Observable,{
	
	viewer:null,
	_url:null,
	constructor:function($config) {
		
		if ($config == null) {
			throw new Exception.CommonException("配置参数不能为空!", null , Exception.CommonException.ParamNotNull);
		}
		
		if ($config.url == null) {
			throw new Exception.CommonException("菜单数据文件路径不能为空!" , null , Exception.CommonException.ParamNotNull);
		}
		
		this._url = $config.url;
		
		Vsg.Menu.GenericMenuProcessor.superclass.constructor.apply(this, arguments);
	},
	
	/**
	 * import the viewer defined 
	 * @param {object} [viewer]
	 */
	setViewer:function($viewer) {
		this.viewer = $viewer;
	},
	
	/**
	 * the base interface processor
	 */
	process:function() {
		Ext.Ajax.request({
			url:this._url,
			success:function($response) {
				var $res = $response.responseText;
				
				/** parse xml object */

			}
		});
	}
	
	
});

/**
 * check the interface 
 */
(function() {
	try {
		Interface.ensureImplements(new Vsg.Menu.GenericMenuProcessor({url:"about:Tabs"}), Vsg.Menu.MenuProcessor);	
	} catch (e) {
		Ext.log("Class Implement Error :"+"[Vsg.Menu.GenericMenuProcessor] , " + e);
	}
})();
